﻿<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>产品首页 - 模切材料小管家</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            /* TDesign 工业品色彩系统 */
            --primary-color: #0052d9;
            --primary-light: #266fe8;
            --primary-dark: #003cab;
            --secondary-color: #f2f3ff;
            --accent-color: #e37318;
            --success-color: #00a870;
            --warning-color: #ed7b2f;
            --error-color: #d54941;
            
            /* 背景色系 */
            --bg-color-page: #f5f7fa;
            --bg-color-container: #ffffff;
            --bg-color-secondray: #f8f9fc;
            
            /* 边框和分割线 */
            --border-color: #e7e7e7;
            --border-color-light: #f0f0f0;
            --border-radius-small: 3px;
            --border-radius-medium: 6px;
            --border-radius-large: 9px;
            
            /* 文字色彩 */
            --text-primary: #1a1a1a;
            --text-secondary: #4e5969;
            --text-placeholder: #86909c;
            --text-disabled: #c9cdd4;
            
            /* 阴影系统 */
            --shadow-1: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
            --shadow-2: 0 1px 4px 0 rgba(0, 0, 0, 0.08);
            --shadow-3: 0 4px 8px 0 rgba(0, 0, 0, 0.12);
            
            /* 间距系统 */
            --space-1: 4px;
            --space-2: 8px;
            --space-3: 12px;
            --space-4: 16px;
            --space-5: 20px;
            --space-6: 24px;
            --space-8: 32px;
            --space-10: 40px;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        }
        
        body {
            background-color: var(--bg-color-page);
            color: var(--text-primary);
            font-size: 14px;
            line-height: 1.5;
            padding-bottom: 64px;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }
        
        .container {
            max-width: 480px;
            margin: 0 auto;
            background: var(--bg-color-container);
            min-height: 100vh;
            box-shadow: var(--shadow-1);
            position: relative;
            overflow-x: hidden;
        }
        
        /* 头部样式 - TDesign 简约风格 */
        .header {
            background: var(--primary-color);
            color: white;
            padding: var(--space-4) var(--space-4) var(--space-5);
            position: relative;
            z-index: 10;
        }
        
        .top-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: var(--space-4);
        }
        
        .back-btn {
            font-size: 18px;
            cursor: pointer;
            opacity: 0.9;
            transition: opacity 0.2s ease;
        }
        
        .back-btn:hover {
            opacity: 1;
        }
        
        .page-title {
            font-weight: 500;
            font-size: 16px;
        }
        
        .actions {
            display: flex;
            gap: var(--space-5);
        }
        
        .actions i {
            font-size: 16px;
            cursor: pointer;
            opacity: 0.9;
            transition: opacity 0.2s ease;
        }
        
        .actions i:hover {
            opacity: 1;
        }
        
        /* 搜索框 */
        .search-container {
            position: relative;
        }
        
        .search-box {
            width: 100%;
            padding: var(--space-3) var(--space-4) var(--space-3) 40px;
            border: none;
            border-radius: var(--border-radius-large);
            font-size: 14px;
            background: rgba(255, 255, 255, 0.9);
            color: var(--text-primary);
            transition: all 0.2s ease;
        }
        
        .search-box:focus {
            outline: none;
            background: white;
            box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
        }
        
        .search-box::placeholder {
            color: var(--text-placeholder);
        }
        
        .search-icon {
            position: absolute;
            left: var(--space-3);
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-placeholder);
            font-size: 16px;
        }
        
        /* 主要内容区域 */
        .main-content {
            min-height: calc(100vh - 120px);
        }
        
        /* 上方tab切换 */
        .category-tabs {
            display: flex;
            background: var(--bg-color-container);
            border-bottom: 1px solid var(--border-color-light);
        }
        
        .tab-item {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: var(--space-4);
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 14px;
            color: var(--text-secondary);
            border-bottom: 2px solid transparent;
            position: relative;
        }
        
        .tab-item:hover {
            color: var(--primary-color);
        }
        
        .tab-item.active {
            color: var(--primary-color);
            border-bottom-color: var(--primary-color);
            font-weight: 500;
            background: var(--secondary-color);
        }
        
        .tab-item i {
            margin-right: var(--space-2);
            font-size: 16px;
        }
        
        /* 产品分类内容区域 */
        .product-categories {
            padding: var(--space-4);
            background: var(--bg-color-container);
        }
        
        /* 广告位样式 */
        .ad-banner {
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
            border-radius: var(--border-radius-medium);
            margin-bottom: var(--space-4);
            position: relative;
            overflow: hidden;
            height: 120px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .ad-banner::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -20px;
            width: 100px;
            height: 100px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 50%;
        }
        
        .ad-banner::after {
            content: '';
            position: absolute;
            bottom: -30px;
            left: -30px;
            width: 80px;
            height: 80px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 50%;
        }
        
        .ad-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: var(--border-radius-medium);
            position: relative;
            z-index: 1;
        }
        
        .ad-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, rgba(0, 82, 217, 0.8) 0%, rgba(38, 111, 232, 0.8) 100%);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: white;
            text-align: center;
            z-index: 2;
        }
        
        .ad-title {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: var(--space-2);
        }
        
        .ad-desc {
            font-size: 12px;
            opacity: 0.9;
        }
        
        .category-section {
            margin-bottom: var(--space-6);
        }
        
        .category-title {
            font-size: 16px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: var(--space-3);
            padding-bottom: var(--space-2);
            border-bottom: 2px solid var(--primary-color);
        }
        
        .product-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: var(--space-3);
        }
        
        .product-item {
            background: var(--bg-color-container);
            border: 1px solid var(--border-color-light);
            border-radius: var(--border-radius-medium);
            padding: var(--space-3);
            cursor: pointer;
            transition: all 0.2s ease;
            text-align: center;
        }
        
        .product-item:hover {
            border-color: var(--primary-color);
            box-shadow: var(--shadow-2);
            transform: translateY(-1px);
        }
        
        .product-icon {
            width: 40px;
            height: 40px;
            background: var(--secondary-color);
            border-radius: var(--border-radius-medium);
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto var(--space-2);
            color: var(--primary-color);
            font-size: 18px;
        }
        
        .product-name {
            font-size: 13px;
            color: var(--text-primary);
            font-weight: 500;
            line-height: 1.3;
        }
        
        .product-count {
            font-size: 11px;
            color: var(--text-placeholder);
            margin-top: var(--space-1);
        }
        
        /* 底部导航栏 - TDesign 简约风格 */
        .tabbar {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: var(--bg-color-container);
            border-top: 1px solid var(--border-color);
            display: flex;
            z-index: 100;
            max-width: 480px;
            margin: 0 auto;
            height: 64px;
        }
        
        .tab-item {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: var(--space-2) 0;
            cursor: pointer;
            transition: color 0.2s ease;
            color: var(--text-placeholder);
        }
        
        .tab-item.active {
            color: var(--primary-color);
        }
        
        .tab-item:hover {
            color: var(--primary-light);
        }
        
        .tab-item i {
            font-size: 18px;
            margin-bottom: var(--space-1);
        }
        
        .tab-item span {
            font-size: 10px;
        }
        
        /* 空状态 */
        .empty-state {
            text-align: center;
            padding: var(--space-8) var(--space-4);
            color: var(--text-placeholder);
        }
        
        .empty-state i {
            font-size: 48px;
            margin-bottom: var(--space-4);
            opacity: 0.5;
        }
        
        .empty-state p {
            font-size: 14px;
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- 头部区域 -->
        <div class="header">
            <div class="top-bar">
                <div class="back-btn" onclick="history.back()">
                    <i class="fas fa-arrow-left"></i>
                </div>
                <div class="page-title">产品分类</div>
                <div class="actions">
                    <i class="fas fa-search" onclick="showSearch()"></i>
                </div>
            </div>
            
            <!-- 搜索框 -->
            <div class="search-container">
                <i class="fas fa-search search-icon"></i>
                <input type="text" class="search-box" placeholder="型号检索" id="searchInput">
            </div>
        </div>
        
        <!-- 主要内容区域 -->
        <div class="main-content">
            <!-- 上方tab切换 -->
            <div class="category-tabs">
                <div class="tab-item active" data-category="processing" onclick="switchCategory('processing')">
                    <i class="fas fa-cogs"></i>
                    <span>加工</span>
                </div>
                <div class="tab-item" data-category="material" onclick="switchCategory('material')">
                    <i class="fas fa-cube"></i>
                    <span>材料</span>
                </div>
            </div>
            
            <!-- 产品分类内容区域 -->
            <div class="product-categories">
                <!-- 广告位 -->
                <div class="ad-banner" onclick="goToAd()">
                    <img src="https://via.placeholder.com/400x120/0052d9/ffffff?text=专业模切加工服务" alt="专业模切加工服务" class="ad-image">
                    <div class="ad-overlay">
                        <div class="ad-title">专业模切加工服务</div>
                        <div class="ad-desc">提供精密模切、冲压成型等专业加工服务</div>
                    </div>
                </div>
                
                <!-- 加工分类 -->
                <div id="processing-categories" class="category-content">
                    <div class="category-section">
                        <div class="category-title">单面胶带</div>
                        <div class="product-grid">
                            <div class="product-item" onclick="goToProductList('tape', 'masking-tape')">
                                <div class="product-icon">
                                    <i class="fas fa-tape"></i>
                                </div>
                                <div class="product-name">美纹纸胶带</div>
                                <div class="product-count">8个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('tape', 'acetate-cloth-tape')">
                                <div class="product-icon">
                                    <i class="fas fa-tape"></i>
                                </div>
                                <div class="product-name">醋酸布胶带</div>
                                <div class="product-count">6个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('tape', 'fiberglass-tape')">
                                <div class="product-icon">
                                    <i class="fas fa-tape"></i>
                                </div>
                                <div class="product-name">玻璃纤维胶带</div>
                                <div class="product-count">4个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('tape', 'pi-tape')">
                                <div class="product-icon">
                                    <i class="fas fa-tape"></i>
                                </div>
                                <div class="product-name">PI胶带</div>
                                <div class="product-count">12个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('tape', 'pet-tape')">
                                <div class="product-icon">
                                    <i class="fas fa-tape"></i>
                                </div>
                                <div class="product-name">PET胶带</div>
                                <div class="product-count">10个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('tape', 'pp-pe-tape')">
                                <div class="product-icon">
                                    <i class="fas fa-tape"></i>
                                </div>
                                <div class="product-name">PP/PE胶带</div>
                                <div class="product-count">7个型号</div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="category-section">
                        <div class="category-title">双面胶带</div>
                        <div class="product-grid">
                            <div class="product-item" onclick="goToProductList('double-tape', 'unsupported-adhesive')">
                                <div class="product-icon">
                                    <i class="fas fa-layer-group"></i>
                                </div>
                                <div class="product-name">无基材双面胶</div>
                                <div class="product-count">15个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('double-tape', 'pet-double-adhesive')">
                                <div class="product-icon">
                                    <i class="fas fa-layer-group"></i>
                                </div>
                                <div class="product-name">PET双面胶</div>
                                <div class="product-count">9个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('double-tape', 'tissue-double-adhesive')">
                                <div class="product-icon">
                                    <i class="fas fa-layer-group"></i>
                                </div>
                                <div class="product-name">绵纸双面胶</div>
                                <div class="product-count">6个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('double-tape', 'foam-double-adhesive')">
                                <div class="product-icon">
                                    <i class="fas fa-layer-group"></i>
                                </div>
                                <div class="product-name">泡棉双面胶</div>
                                <div class="product-count">11个型号</div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="category-section">
                        <div class="category-title">保护膜</div>
                        <div class="product-grid">
                            <div class="product-item" onclick="goToProductList('protective-film', 'pu-film')">
                                <div class="product-icon">
                                    <i class="fas fa-shield-alt"></i>
                                </div>
                                <div class="product-name">PU保护膜</div>
                                <div class="product-count">8个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('protective-film', 'silicone-film')">
                                <div class="product-icon">
                                    <i class="fas fa-shield-alt"></i>
                                </div>
                                <div class="product-name">硅胶保护膜</div>
                                <div class="product-count">5个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('protective-film', 'acrylic-film')">
                                <div class="product-icon">
                                    <i class="fas fa-shield-alt"></i>
                                </div>
                                <div class="product-name">亚克力保护膜</div>
                                <div class="product-count">7个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('protective-film', 'cpp-film')">
                                <div class="product-icon">
                                    <i class="fas fa-shield-alt"></i>
                                </div>
                                <div class="product-name">CPP保护膜</div>
                                <div class="product-count">4个型号</div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 材料分类 -->
                <div id="material-categories" class="category-content" style="display: none;">
                    <div class="category-section">
                        <div class="category-title">单面胶带</div>
                        <div class="product-grid">
                            <div class="product-item" onclick="goToProductList('tape', 'masking-tape')">
                                <div class="product-icon">
                                    <i class="fas fa-tape"></i>
                                </div>
                                <div class="product-name">美纹纸胶带</div>
                                <div class="product-count">8个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('tape', 'acetate-cloth-tape')">
                                <div class="product-icon">
                                    <i class="fas fa-tape"></i>
                                </div>
                                <div class="product-name">醋酸布胶带</div>
                                <div class="product-count">6个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('tape', 'fiberglass-tape')">
                                <div class="product-icon">
                                    <i class="fas fa-tape"></i>
                                </div>
                                <div class="product-name">玻璃纤维胶带</div>
                                <div class="product-count">4个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('tape', 'pi-tape')">
                                <div class="product-icon">
                                    <i class="fas fa-tape"></i>
                                </div>
                                <div class="product-name">PI胶带</div>
                                <div class="product-count">12个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('tape', 'pet-tape')">
                                <div class="product-icon">
                                    <i class="fas fa-tape"></i>
                                </div>
                                <div class="product-name">PET胶带</div>
                                <div class="product-count">10个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('tape', 'pp-pe-tape')">
                                <div class="product-icon">
                                    <i class="fas fa-tape"></i>
                                </div>
                                <div class="product-name">PP/PE胶带</div>
                                <div class="product-count">7个型号</div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="category-section">
                        <div class="category-title">双面胶带</div>
                        <div class="product-grid">
                            <div class="product-item" onclick="goToProductList('double-tape', 'unsupported-adhesive')">
                                <div class="product-icon">
                                    <i class="fas fa-layer-group"></i>
                                </div>
                                <div class="product-name">无基材双面胶</div>
                                <div class="product-count">15个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('double-tape', 'pet-double-adhesive')">
                                <div class="product-icon">
                                    <i class="fas fa-layer-group"></i>
                                </div>
                                <div class="product-name">PET双面胶</div>
                                <div class="product-count">9个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('double-tape', 'tissue-double-adhesive')">
                                <div class="product-icon">
                                    <i class="fas fa-layer-group"></i>
                                </div>
                                <div class="product-name">绵纸双面胶</div>
                                <div class="product-count">6个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('double-tape', 'foam-double-adhesive')">
                                <div class="product-icon">
                                    <i class="fas fa-layer-group"></i>
                                </div>
                                <div class="product-name">泡棉双面胶</div>
                                <div class="product-count">11个型号</div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="category-section">
                        <div class="category-title">保护膜</div>
                        <div class="product-grid">
                            <div class="product-item" onclick="goToProductList('protective-film', 'pu-film')">
                                <div class="product-icon">
                                    <i class="fas fa-shield-alt"></i>
                                </div>
                                <div class="product-name">PU保护膜</div>
                                <div class="product-count">8个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('protective-film', 'silicone-film')">
                                <div class="product-icon">
                                    <i class="fas fa-shield-alt"></i>
                                </div>
                                <div class="product-name">硅胶保护膜</div>
                                <div class="product-count">5个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('protective-film', 'acrylic-film')">
                                <div class="product-icon">
                                    <i class="fas fa-shield-alt"></i>
                                </div>
                                <div class="product-name">亚克力保护膜</div>
                                <div class="product-count">7个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('protective-film', 'cpp-film')">
                                <div class="product-icon">
                                    <i class="fas fa-shield-alt"></i>
                                </div>
                                <div class="product-name">CPP保护膜</div>
                                <div class="product-count">4个型号</div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="category-section">
                        <div class="category-title">电磁屏蔽材料</div>
                        <div class="product-grid">
                            <div class="product-item" onclick="goToProductList('emi-shielding', 'anisotropic-conductive-film')">
                                <div class="product-icon">
                                    <i class="fas fa-broadcast-tower"></i>
                                </div>
                                <div class="product-name">异向导电胶膜</div>
                                <div class="product-count">6个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('emi-shielding', 'single-conductive-tape')">
                                <div class="product-icon">
                                    <i class="fas fa-broadcast-tower"></i>
                                </div>
                                <div class="product-name">单面导电胶带</div>
                                <div class="product-count">8个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('emi-shielding', 'conductive-foam')">
                                <div class="product-icon">
                                    <i class="fas fa-broadcast-tower"></i>
                                </div>
                                <div class="product-name">导电泡棉</div>
                                <div class="product-count">5个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('emi-shielding', 'double-conductive-tape')">
                                <div class="product-icon">
                                    <i class="fas fa-broadcast-tower"></i>
                                </div>
                                <div class="product-name">双面导电胶带</div>
                                <div class="product-count">7个型号</div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="category-section">
                        <div class="category-title">光学材料</div>
                        <div class="product-grid">
                            <div class="product-item" onclick="goToProductList('optical', 'oca')">
                                <div class="product-icon">
                                    <i class="fas fa-eye"></i>
                                </div>
                                <div class="product-name">OCA</div>
                                <div class="product-count">12个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('optical', 'light-shielding-tape')">
                                <div class="product-icon">
                                    <i class="fas fa-eye"></i>
                                </div>
                                <div class="product-name">遮光胶带</div>
                                <div class="product-count">9个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('optical', 'polarizer')">
                                <div class="product-icon">
                                    <i class="fas fa-eye"></i>
                                </div>
                                <div class="product-name">偏光片</div>
                                <div class="product-count">6个型号</div>
                            </div>
                            <div class="product-item" onclick="goToProductList('optical', 'reflective-sheet')">
                                <div class="product-icon">
                                    <i class="fas fa-eye"></i>
                                </div>
                                <div class="product-name">反射片</div>
                                <div class="product-count">4个型号</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 底部导航（统一） -->
        <div class="tabbar">
            <div class="tab-item" onclick="location.href='home.html'">
                <i class="fas fa-home"></i>
                <span>首页</span>
            </div>
            <div class="tab-item" onclick="location.href='demand-list.html'">
                <i class="fas fa-search"></i>
                <span>求购</span>
            </div>
            <div class="tab-item" onclick="location.href='publish-select.html'">
                <i class="fas fa-plus-circle"></i>
                <span>发布</span>
            </div>
            <div class="tab-item" onclick="location.href='consultation.html'">
                <i class="fas fa-comments"></i>
                <span>客服</span>
            </div>
            <div class="tab-item" onclick="location.href='profile.html'">
                <i class="fas fa-user"></i>
                <span>我的</span>
            </div>
        </div>
    </div>
    
    <script>
        // 切换分类
        function switchCategory(category) {
            // 更新上方tab状态
            document.querySelectorAll('.tab-item').forEach(item => {
                item.classList.remove('active');
            });
            document.querySelector(`[data-category="${category}"]`).classList.add('active');
            
            // 切换内容区域
            document.getElementById('processing-categories').style.display = category === 'processing' ? 'block' : 'none';
            document.getElementById('material-categories').style.display = category === 'material' ? 'block' : 'none';
        }
        
        // 跳转到产品列表页
        function goToProductList(category, productName) {
            const currentCategory = document.querySelector('.tab-item.active').dataset.category;
            if (currentCategory === 'processing') {
                location.href = `product-list-processing.html?type=${category}&product=${productName}`;
            } else {
                location.href = `product-list-material.html?type=${category}&product=${productName}`;
            }
        }
        
        // 广告点击事件
        function goToAd() {
            location.href = 'contact.html?type=processing';
        }
        
        // 搜索功能
        function showSearch() {
            document.getElementById('searchInput').focus();
        }
        
        // 搜索输入处理
        document.getElementById('searchInput').addEventListener('input', function(e) {
            const searchTerm = e.target.value.trim();
            if (searchTerm.length > 0) {
                // 这里可以添加搜索逻辑
                console.log('搜索:', searchTerm);
            }
        });
        
        // 搜索框回车事件
        document.getElementById('searchInput').addEventListener('keypress', function(e) {
            if (e.key === 'Enter') {
                const searchTerm = e.target.value.trim();
                if (searchTerm) {
                    location.href = `product-list.html?search=${encodeURIComponent(searchTerm)}`;
                }
            }
        });
        
        // 页面加载时检查URL参数
        document.addEventListener('DOMContentLoaded', function() {
            const urlParams = new URLSearchParams(window.location.search);
            const category = urlParams.get('category');
            
            if (category === 'material') {
                switchCategory('material');
            } else {
                switchCategory('processing');
            }
        });
        
        // 底部导航切换
        document.querySelectorAll('.tab-item').forEach(item => {
            item.addEventListener('click', function() {
                document.querySelectorAll('.tab-item').forEach(t => t.classList.remove('active'));
                this.classList.add('active');
            });
        });
    </script>
</body>
</html>

